home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Graphics / sKulpt / skulpt-src / Types.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-30  |  13.3 KB  |  443 lines

  1. typedef unsigned char SMALLBOOL;
  2.  
  3. // Structure pour les gadgets Sculpt
  4. typedef struct
  5. {
  6. #ifndef _AMIGA_
  7.     HBITMAP    hbm;
  8.     HDC        hdc;
  9.     HGDIOBJ    hold;
  10. #else
  11.     struct DiskObject *hIcon;
  12. #endif
  13. } SkulptGadget;
  14.  
  15. typedef struct
  16. {
  17.     SkulptGadget    *Gad;
  18.     RECT            rect;
  19. } WinGadget;
  20.  
  21. // Structure infos additionnelles pour fenêtre 2D
  22. typedef struct
  23. {
  24.     SMALLBOOL bFirstPaint;
  25.     WinGadget Widgets[13];
  26.     HDC hdcDBuf, hdcTBuf;
  27.      HBITMAP    hbDBuf;
  28. #ifndef _AMIGA_
  29.     HGDIOBJ    holdDBuf;
  30.     HFONT    holdDFont;
  31.     HGDIOBJ    holdTBuf;
  32.     HBRUSH    holdTBrush;
  33.     HFONT    holdTFont;
  34. #else
  35.     DC dcDBuf;
  36.     struct Region *hClip;
  37. #endif
  38. } WinThings;
  39.  
  40. // Objets géométriques basiques
  41. typedef struct
  42. {
  43.     D3DVECTOR        vPoint;
  44.     D3DVECTOR        vPointBack;
  45.     D3DVECTOR        vNormal;
  46.     SMALLBOOL        bSelected;
  47.     SMALLBOOL        bHidden;
  48.     SMALLBOOL        bEnabled;
  49.     SMALLBOOL        bSmooth;
  50.     short            iDepend;
  51. } gSommet;
  52.  
  53. typedef struct
  54. {
  55.     short            iSommets[2];
  56.     SMALLBOOL        bHidden;
  57.     SMALLBOOL        bEnabled;
  58. } gEdge;
  59.  
  60. typedef struct
  61. {
  62.     char            sName[20];   // Nom du material
  63.     SMALLBOOL       bEnabled;    // Material enabled o/n
  64.     D3DMATERIAL7    mtrl;        // Propriétés de couleur diffuse / emissive / specular du material
  65.     SMALLBOOL       bTextured;   // Texturé o/n
  66.     char            sTexName[80];// Nom du fichier de texture pour l'uploader quand on redimensionne la fenêtre 3D (création du contexte fenêtre 3D)
  67.     W3D_Texture     *hTexture;   // Handle texture une fois uploadée dans le contexte W3D (pour redraw 3D)
  68. } gMtrl;
  69.  
  70. typedef struct
  71. {
  72.     short            iSommets[3]; // 3 indices dans le tableau des sommets
  73. #ifndef _AMIGA_
  74.     D3DVERTEX        pSommets[6]; // 2 facettes D3D : clockwise et anticlockwise
  75. #endif
  76.     short           u[3];
  77.     short           v[3];
  78.     short           iMtrl;
  79.     SMALLBOOL        bHidden;
  80.     SMALLBOOL        bEnabled;
  81. } gTri;
  82.  
  83. typedef struct
  84. {
  85.     SMALLBOOL        bEnabled;
  86.     SMALLBOOL        bSelected;
  87.     SMALLBOOL        bLit;
  88.     D3DLIGHT7        lLamp;
  89. } gLamp;
  90.  
  91. typedef struct
  92. {
  93.     ID3DXSimpleShape *pShape;
  94.     D3DMATERIAL7    mtrl;
  95.     SMALLBOOL        bHidden;
  96.     SMALLBOOL        bEnabled;
  97.     SMALLBOOL        bSelected;
  98.     D3DVECTOR        vOrigin;
  99. } gObject;
  100.  
  101. /*
  102. SCULPT ANIMATE FILE FORMATS
  103. The files generated by Sculpt Animate follow the IFF standard, with
  104. the exception of the RGB files described in chapter 3.    The .i.IFF.i.
  105. format is described in the Amiga ROM Kernel Manual, and sample
  106. programs to read and write such files may be found i
  107.  
  108. The file formats used by the Sculpt series of programs for the Amiga
  109. are constantly changing, through the addition of new chunk types and
  110. the definition of reserved 'padding' bytes in existing chunks.  In
  111. most cases this will not present problems either
  112.  
  113. Image files
  114. Images are written as .i.ILBM; IFF files and need little further
  115. explanation here, since they conform to the published standards.
  116. Because of the variety of image size and mode that Sculpt Animate
  117. uses, programs which intend to use these images shouldn'
  118.  
  119. Images saved in conjunction with frame buffer usage are non-standard,
  120. but follow the ILBM format.  These images have no CMAP chunk, so the
  121. bit planes represent actual 24-bit color intensity values:  8 planes
  122. each of red, green, and blue--stored in that
  123.  
  124. Scene files
  125. Scene files contain a number of data chunks.  Each chunk is described
  126. below in terms of a C structure.  The comments beside each structure
  127. member should make its meaning clear.  The FORM name for a scene file
  128. is 'SC3D'.
  129. */
  130.  
  131. /*    Chunk 'LAMP' contains one or more of the following structures,
  132.     the number of structures is determined by the length of the chunk
  133. */
  134.  
  135. struct    elamp
  136.       {  long int pos[3];        /* The position of the lamp         */
  137.      long int brightness;        /* The brightness of the lamp        */
  138.      unsigned char color[3];    /* The color of the lamp as a triple
  139.                        of RGB values, range 0 to 255        */
  140.      char pad;            /* Unused                    */
  141.       };
  142.  
  143. /*    Chunk 'OBSV' contains a specification of an observer according
  144.     to the following structure
  145. */
  146.  
  147. struct observer
  148.     {long int obsmode;        /* Rendering mode as follows
  149.                       0  Painting
  150.                       1  Snapshot
  151.                       2  Photo
  152.                       3  Wireframe
  153.                       4  Sketch
  154.                       5  Scanline painting
  155.                       6  Scanline snapshot            */
  156.      long int fl;            /* Focal length of lens in millimeters  */
  157.      long int althresh;        /* For internal use only            */
  158.      long int threshhold;        /* For internal use only            */
  159.      long int robspos[3];        /* Position of observer            */
  160.      long int rtarget[3];        /* Position of target            */
  161.      short int hires;        /* 0 for low
  162.                        1 for high resolution            */
  163.      short int lace;        /* 0 for non-interlace
  164.                        1 for interlace                */
  165.      short int lens;        /* Lens type as follows:
  166.                         0  Normal 50mm
  167.                         1  Wide angle 28mm
  168.                         2  Telephoto 135mm
  169.                         3  Special, as given by spfl    */
  170.      short int manexpflg;        /* 0 for auto exposure
  171.                        else manual                */
  172.      long int spfl;         /* Focal length of special lens        */
  173.      long int expoverride;        /* Current value for exposure override  */
  174.      long int manexpval;        /* Value when in manual mode        */
  175.      long int picsize;        /* Image size as follows
  176.                     0  Tiny
  177.                     1  Small
  178.                     2  Medium
  179.                     3  Full
  180.                     4  Jumbo
  181.                     5  Video                */
  182.      long int tilt;         /* Tilt angle                */
  183.      long int aamode;        /* Anti aliasing mode as follows:
  184.                     0  None
  185.                     1  Good
  186.                     2  Best                 */
  187.      short int dithatten;        /* Dithering attenuation as follows:
  188.                     0   Standard
  189.                     50  Half standard, etc
  190.                     100 None                */
  191.      short int colorlock;        /* Non zero for locking colors        */
  192.      short int explock;        /* Non zero for locking exposure value  */
  193.      short int expexp;        /* Internal use only            */
  194.      long int expmant;        /* Internal use only            */
  195.      unsigned char wfcol1[4],wfcol2[4];
  196.                     /* Colors for wire frame images        */
  197.      short int displayearly;
  198.                     /* Non zero to request early display
  199.                        of rendered image */
  200.      short int dummy[29];        /* Reserved for future use, should be set
  201.                        to zero.                 */
  202.     };
  203.  
  204. /*    Chunk 'WRLD' contains a specification of the world using the
  205.     following structure
  206. */
  207.  
  208. struct world
  209.     {long int groundmode;        /* 0 None, 1 solid, 2 checkered */
  210.      long int skymode;        /* 0 None, 1 solid, 2 graduated */
  211.      long int checkscale;        /* Size of checkered ground */
  212.      unsigned char backbright[3];
  213.                     /* Intensity of background illumination
  214.                        as RGB values on a scale of 0 to 255 */
  215.      unsigned char grcol1[3],grcol2[3];
  216.                     /* Colors of ground squares as RGB
  217.                        values on a scale of 0 to 255        */
  218.      unsigned char skycol1[3],skycol2[3];
  219.                    /* Sky colors as RGB values on
  220.                       a scale of 0 to 255            */
  221.      long int dummy[20];       /* Reserved for future use, should be set
  222.                       to zero                    */
  223.     };
  224.  
  225.  
  226. /*    Chunk 'VERT' contains an array of the following structure, one
  227.     element for each vertex to be included in the scene
  228. */
  229.  
  230. struct evertex
  231.     {
  232.         long int pos[3];       /* Position of vertex            */
  233.     };
  234.  
  235.  
  236. /*    Chunk 'EDGE' contains an array of the following structure, one
  237.     element for each edge in the scene
  238. */
  239.  
  240.  
  241. struct eedge
  242.     {long int evertexi[2];      /* Indices denoting vertices in VERT chunk */
  243.     };
  244.  
  245.  
  246. /*    Chunk 'FACE' cantains an array of the following structures, one
  247.     element for each face in the scene
  248. */
  249.  
  250.  struct eface
  251.     {long int evertexi[3];     /* Indices denoting vertices in VERT chunk */
  252.      unsigned char color[3];
  253.                  /* Face color as RGB values in the range
  254.                     0 to 255                    */
  255.      unsigned char texture;  /* The most significant bit is set
  256.                    if smoothing is needed.  The remaining
  257.                    bits represent a texture value as follows:
  258.                     0  Dull
  259.                     1  Shiny
  260.                     2  Mirror
  261.                     3  Luminous
  262.                     4  Glass
  263.                     5  Metal
  264.                     6  Glass2                */
  265.     };
  266.  
  267.  
  268. /*    The chunk 'HIER' contains an array of the following structures,
  269.     one element for each name in the hierarchy
  270. */
  271.  
  272. struct ehier
  273.     {short int parindex;    /* index to the hierarchy element
  274.                    that is the parent of this element        */
  275.      char name[10];     /* Name of hierarchy element            */
  276.      short int type;    /* Type of element, as follows:
  277.                     0  Empty
  278.                     2  Lamp
  279.                     4  Path
  280.                     6  Target
  281.                     8  Observer location
  282.                        10  Vertices
  283.                       Bit 0x10 is set if a local origin is
  284.                       used by this element            */
  285.      short int loverti;    /* index to the vertex that is the local
  286.                    of this element                */
  287.      long int lo[3];    /* Local origin position            */
  288.     };
  289.  
  290.  
  291. /*    Chunk 'VNAM' contains an array of the following structure, one
  292.     element for each vertex that has a hierarchy name
  293. */
  294.  
  295.  
  296. struct ename
  297.     {short int object;    /* index to vertex                */
  298.      short int name;    /* index to hierarchy name            */
  299.     };
  300.  
  301. /*    The chunk 'LNAM' contains an array of short integer values
  302.     representing the hierarchy indices for each lamp.  Unnamed
  303.     lamps are given an index of -1.
  304. */
  305.  
  306. /*    The chunk 'PATH' contains an array of the following structure,
  307.     one element for each vertex that is a part of a path.
  308. */
  309.  
  310. struct epath
  311.     {int evertexi;        /* Index to vertex                */
  312.      long int etumbleaxes[3][3];
  313.                 /* Tumble axis directions, scaled by a
  314.                    factor of 1L<<30                */
  315.      int terminator;
  316.                 /* Code value with bits set as follows:
  317.                        1  end of path
  318.                        2  end of loop
  319.                        4  interpolated                */
  320.     };
  321.  
  322.  
  323. /*    The chunk 'KNOT' contains an array of the following structure,
  324.     one element for each knot vertex included in the scene
  325. */
  326.  
  327.  
  328. struct eknot
  329.     {long int eslopes[2][3];
  330.                 /* Knot slopes scaled by 1L<<30         */
  331.      long int espeeds[2];
  332.                 /* Speed values scaled by 1L<<30        */
  333.      short int evertexi;
  334.                 /* index to vertex                */
  335.      short int terminator;
  336.                 /* Code value with bits set as follows:
  337.                        1  end of spline
  338.                        2  end of loop
  339.                        4  interpolated
  340.                        8  cusp                    */
  341.     };
  342.  
  343. /*    The chunk 'SPLN' contains an array of the following structure,
  344.     one element for each non-knot spline vertex
  345. */
  346.  
  347. struct espline
  348.     {short int evertexi;
  349.                 /*  Index to vertex                */
  350.      short int evertknoti;
  351.                 /*  Index to knot                */
  352.     };
  353.  
  354. /*    The chunk 'CSGE' contains a CSG object type identifier,
  355.    and a long array of indices to vertices of the object
  356. */
  357.  
  358. struct ecsg
  359.     {short int type;    /* set as follows:
  360.                    0 sphere                    */
  361.      long int evertexi[12];
  362.                 /*  Indices to vertices in CSG sphere        */
  363.     };
  364.  
  365. /*
  366. Take files
  367. A take is automatically saved to disk at frequent intervals as a file whose name ends with '.take'.  It is an IFF file with a form name called 'TAKE' containing the following chunks.
  368. */
  369.  
  370. /*    Chunk 'THDR' contains the following structure:
  371. */
  372.  
  373. struct take
  374.     {int frmode;        /* set to 1 for frame mode            */
  375.      int rammode;        /* set as follows:
  376.                      0 not RAM animation
  377.                      1 normal RAM animation
  378.                      2 economy RAM animation
  379.                      3 ANIM-5 RAM animation            */
  380.      int numframes;     /* number of frames in the take         */
  381.      int curframe;        /* current frame number             */
  382.      int saveimages;    /* set to 1 if frames are to be saved to disk */
  383.      int prevsize;        /* preview size as follows:
  384.                      2    Medium
  385.                      3 Full                    */
  386.      int motionblur;
  387.                 /* set for motion blur                */
  388.      int loopmode;        /* set as follows:
  389.                      0    no loop
  390.                      1    loop
  391.                      2    oscillation                */
  392.      int framebuffer;    /* set if frame buffer is in use        */
  393.      int framecontroller;    /* set if frame controller is in use        */
  394.      char anidrawer[22];    /* animation drawer name            */
  395.      char foreground[22];    /* foreground file name             */
  396.      char background[22];    /* background file name             */
  397.      char pad1[22];     /* unused, should be set to zero        */
  398.      char fcname[22];    /* frame controller name            */
  399.      char pad2[22];     /* unused, should be set to zero        */
  400.      char fbname[22];    /* frame buffer name                */
  401.      short int colorlock;    /* set when colors are locked            */
  402.      char creg[96];     /* current color registers            */
  403.      short int explock;    /* set when exposure values are locked        */
  404.      short int expexp;    /* internal use only                */
  405.      long int expmant;    /* internal use only                */
  406.      short int obsmode;    /* Rendering mode as follows
  407.                     0  Painting
  408.                     1  Snapshot
  409.                     2  Photo
  410.                     3  Wireframe
  411.                     4  Sketch
  412.                     5  Scanline painting
  413.                     6  Scanline snapshot            */
  414.      short int hires;    /* 0 for low and 1 for high resolution        */
  415.      short int lace;    /* 0 for non-interlace 1 for interlace        */
  416.      short int picsize;    /* Image size as follows
  417.                     0  Tiny
  418.                     1  Small
  419.                     2  Medium
  420.                     3  Full
  421.                     4  Jumbo
  422.                     5  Video                    */
  423.      short int bitplanes;    /* number of bit planes             */
  424.      unsigned char wfcol1[4],wfcol2[4];
  425.                 /* colors for wire frame rendering        */
  426.      char padding[64];    /* unused, should be set to zero        */
  427.     };
  428.  
  429.  
  430. /*    The remaining chunks are of type 'TFRM', one for each frame in
  431.     the take.  Each chunk contains the following structure
  432. */
  433.  
  434. struct etakeframe
  435.     {short int framenum;    /* Frame number                 */
  436.      short int keyframe;    /* Set to 1 if it is a keyframe         */
  437.      short int duration;    /* Duration, in jiffies             */
  438.      char imadrawer[22];    /* image drawer name                */
  439.      char scedrawer[22];    /* scene drawer name                */
  440.      char padding[64];    /* unused, should be set to zero        */
  441.     };
  442.  
  443.